<template>
	<view class="flex align-center mx-2 py-2 border-bottom" @click="openChat">
		<image :src="item.avater" style="width: 80rpx; height: 80rpx;" class="rounded-circle mr-2" mode=""></image>
		<view class="flex flex-column flex-1">
			<view class="flex align-center justify-between">
				<text class="font-md">{{item.username}}</text>
				<text class="font-sm text-secondary">{{item.update_time | formatTime}}</text>
			</view>
			<view class="flex align-center justify-between">
				<text class="font text-secondary text-ellipsis" style="width: 500rpx;">{{item.data}}</text>
				<uni-badge :text="item.noread" type="error"></uni-badge>
			</view>
		</view>
	</view>
</template>

<script>
	import uniBadge from '@/components/uni-ui/uni-badge/uni-badge.vue';
	import $T from '@/common/time.js'
	export default{
		props: {
			item: Object,
			index: Number
		},
		components: {
			uniBadge
		},
		//过滤器
		filters: {
			formatTime: function(value) {
				return $T.gettime(value);
			}
		},
		methods: {
			openChat() {
				uni.navigateTo({
					url: '../../pages/user-chat/user-chat',
				});
			}
		}
		
	}
</script>

<style>
</style>